'''
requests 中可以通过Session发送请求，可以自动管理cookie

'''

import requests
s  = requests.Session() # 创建一个Session
print("登录之前的cookie：",s.cookies)
# 登陆接口
url = "https://www.bagevent.com/user/login"

cs = {
"access_type":	"1",
"loginType":"1",
"emailLoginWay"	:"0",
"account"	:"2780487875@qq.com",
"password"	:"qq2780487875",
"remindmeBox" :"on",
"remindme"	:"1"

}
r = s.post(url,data=cs)  # 使用Session发送请求
#print(r.text)
print("登录之后的cookie：",s.cookies)
print("====================================================================================")

# dashborad接口
url = "https://www.bagevent.com/account/dashboard"
r= s.get(url)
#print(r.text)

url = "https://www.bagevent.com/user/login_out"
r = s.get(url)
print("退出登录之后的cookie：",s.cookies)

